package com.marketfarm.client;

import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeHandler;
import com.marketfarm.client.CachePagina.Pagina;

public class HistoryHandler implements ValueChangeHandler<String> {

	@Override
	public void onValueChange(ValueChangeEvent<String> event) {
		if(event.getValue() != null){
			Pagina pagina = Pagina.get(event.getValue());
			if(pagina == null) pagina = Pagina.LOGIN;
			
			CachePagina.getInstance().updatePaginaAtual(pagina);
		}
	}
}